﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Kevin.Framework.Data;
using System.Data;
using Kevin.Framework.Data.Query;

namespace WebTest
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.dataBind1.Data = new TU_ActionInfo();
                //Kevin.Framework.Data.Configuration.DbConfigurationSectionGroup
                //Kevin.Framework.Data.Database db = DatabaseFactory.Create("AccreditManage");
                //db.ExecuteNonQuery(System.Data.CommandType.Text, "insert into TU_Action(actionid,actionName,actionDesc) values(32,'test','test')");
                init();
                TU_ActionInfo action = new TU_ActionInfo() { ActionDesc = "" };
                DataTable dt = action.SelectedByProperties();
            }
        }
        private void init()
        {
            TU_ActionInfo action1 = new TU_ActionInfo();
            action1.ActionID = 111;
            action1.ActionName = "111";
            action1.ActionDesc = "111";
            action1.Insert();

            TU_ActionInfo action3 = new TU_ActionInfo();
            action3.ID = action1.ID;
            bool selected = action3.SelectByKeys();
            

            if (selected)
            {
                this.dataBind1.Data = action3;
            }

            TU_ActionInfo action = new TU_ActionInfo();

            int recordCount = 0;
            int pageIndex = 0; int pageSize = 10;
            List<TU_ActionInfo> list = action.SelectedByProperties<TU_ActionInfo>(out recordCount, pageSize, pageIndex,"ActionName desc");
            
        }
    }
}
